package MOLE.Bill;

import java.util.*;
import MOLE.*;

/** 
 BillesAgent ��ժҪ˵����
 
 BillGroup ....
 
 public class BillesGroup : Bills
*/
public class BillesGroup extends Bill
{

	private String OsStatu = "ok";
	private String MyKey = "daili.shishicai.cn";
	 public int GroupId = 0;
	public int GroupOwner = 0;
	public BillesGroup(int dataid)
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
		GroupId = dataid;
		GroupOwner = MOLE.str.ConvertToInt((new MOLE.SQLOS("agentdg"))._GetFieldVale("agent_id", "  data_id=" + String.valueOf(GroupId)));
	}

	public BillesGroup()
	{
	}

	//
	public ArrayList Chupiao()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region
		ArrayList all = new ArrayList();

		String sql = "select * from agentdg where data_id=" + String.valueOf(GroupId);
		DataTable dt = MOLE.SQL.GetDataTable(sql);
		for (int i = 0;i < dt.Rows.size();i++)
		{
			int billid = MOLE.str.ConvertToInt(dt.Rows[i]["adid"].toString());
			ArrayList billarr = (new Bill(billid))._Chwpyao();
			all = MOLE.comm.HabinArraylist(all, billarr);
		}

		GetToAgent(); //tonzhi agent

		return all;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion
	}

	public final boolean GetToAgent()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region
		String url = (new MOLE.Bill.User(GroupOwner)).AgentUrl;
		MOLE.str o = new MOLE.str();
		o.Add("data_id", String.valueOf(GroupId));
		o.Add("result", "0");
		o.Add("msg", "");
		String urlPara = o.GetUrlPara("asc");
		  url = url + "?" + urlPara + "&md5str=" + MOLE.EncryptDecrypt.MD5(GroupId + 0 + MyKey).toLowerCase();

		try
		{
			OsStatu = MOLE.xmlHttp.getData(url);
		}
		catch (java.lang.Exception e)
		{
		}

		String logstr = "��Ʊ dataid:" + String.valueOf(GroupId) + "<br>" + " ״̬:" + OsStatu;
		MOLE.SQLOS log = new SQLOS("log");
		log.RS("logcontent", logstr);
		log.Insert();

		 return true;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion

	}

//		public int GetDataidOwner()
//		{
//			 
//
//		}










}